package org.kamionowski.supreme.controllers.tools;

import org.kamionowski.supreme.services.search.tools.FileType;

import java.beans.PropertyEditorSupport;

/**
 * Created by IntelliJ IDEA.
 * User: Marcin Kamionowski
 * Date: 05.04.11
 * Time: 00:10
 */
public class FileTypeEditor extends PropertyEditorSupport {
    @Override
    public String getAsText() {
        FileType type = (FileType)getValue();
        return type.toString();
    }

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        FileType type = FileType.valueOf(text);
        setValue(type);
    }
}
